unit ResultadoEstatistica;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ActnList, ImgList, ComCtrls, DB, DBClient, Grids, DBGrids,
  DBTables, StdCtrls, Buttons;

type
  TFormResultadoEstatistica = class(TForm)
    ListView2: TListView;
    ImageList2: TImageList;
    ActTotal: TActionList;
    ActionVoltar: TAction;
    DBGridResultado: TDBGrid;
    cdsResultado: TClientDataSet;
    DataSource1: TDataSource;
    QueryResultado: TQuery;
    Label1: TLabel;
    DateTimePicker1: TDateTimePicker;
    Label2: TLabel;
    DateTimePicker2: TDateTimePicker;
    BitBtnOK: TBitBtn;
    procedure ActionVoltarExecute(Sender: TObject);
    procedure ListView2Click(Sender: TObject);
    procedure FormKeyUp(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure FormActivate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormResultadoEstatistica: TFormResultadoEstatistica;

implementation

{$R *.dfm}

procedure TFormResultadoEstatistica.ActionVoltarExecute(Sender: TObject);
begin
   close;
end;

procedure TFormResultadoEstatistica.ListView2Click(Sender: TObject);
var List: TListView;
begin
if TListView(Sender).Selected <> nil then
  begin
        List := TlistView(Sender);
        ActTotal.Actions[List.Selected.StateIndex].Execute;
  end;
end;

procedure TFormResultadoEstatistica.FormKeyUp(Sender: TObject;
  var Key: Word; Shift: TShiftState);
begin
if Key = VK_ESCAPE then
     self.close;
end;

procedure TFormResultadoEstatistica.FormActivate(Sender: TObject);
begin
DateTimePicker1.Date := now;
DateTimePicker2.Date := now;
end;

end.
